<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/bluetooth/resources/bluetooth-test.js"></script>
<script src="/bluetooth/resources/bluetooth-fake-devices.js"></script>
<script>
'use strict';
 let descriptorUUID = '00002906-0000-1000-8000-00805f9b34fb';
bluetooth_test(() => {
   return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter')
    .then(() => requestDeviceWithTrustedClick({
      filters: [{services: ['health_thermometer']}]}))
    .then(device => device.gatt.connect())
    .then(gattServer => gattServer.getPrimaryService('health_thermometer'))
    .then(service => service.getCharacteristic('measurement_interval'))
    .then(characteristic => {
      return assert_promise_rejects_with_message(
        // Valid Range is not present in this characteristic
        characteristic.getDescriptor(descriptorUUID),
        new DOMException(
          'No Descriptors matching UUID ' + descriptorUUID +
          ' found in Characteristic with UUID ' + measurement_interval.uuid + '.',
          'NotFoundError'));
    })
}, 'Request for absent descriptor. Reject with NotFoundError.');
</script>
